<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'comments.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
    <style type="text/css">
		body {TEXT-ALIGN: center;}
		#order_detail {
			MARGIN-RIGHT: auto;
			MARGIN-LEFT: auto;
		}
	</style>
  </head>
  
  <body>
  <table width="600" border="1">
    <tr>
      <td width="99">产品名称</td>
      <td width="223">${product.PName }</td>
      <td width="256" rowspan="4" align="center"><img src="/wsd/image/product/${product.image}" width="250" height="200" /></td>
    </tr>
    <tr>
      <td>条形码</td>
      <td>${product.barcode };</td>
    </tr>
    <tr>
      <td>厂商</td>
      <td>${product.factory }</td>
    </tr>
    <tr>
      <td>类别</td>
      <td>${product.model }</td>
    </tr>
  </table>
  <hr width="600">
  <c:forEach items="${product.productComments}" var="comment">
	  <table width="600" border="1">
	    <tr>
	      <td width="101">用户名</td>
	      <td width="483">${comment.users.username }</td>
	    </tr>
	    <tr>
	      <td>评论时间</td>
	      <td><fmt:formatDate value="${comment.PCTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
	    </tr>
	    <tr>
	      <td>内容</td>
	      <td>${comment.PCContent}</td>
	    </tr>
	    <tr>
	      <td colspan="2"><div align="right"><a href='/wsd/admin/product_deleteComments.action?cid=${comment.PCId}&pid=${product.PId}'>删除</a></div></td>
	    </tr>
	  </table>
  </c:forEach>
  <p>&nbsp;</p>
  </body>
</html>
